<!DOCTYPE html>
<html lang="en"  xmlns:th="http://www.thymeleaf.org">

<head>
    <meta charset="UTF-8">
    <title>购买</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link rel="stylesheet" href="/lib/layui-v2.5.4/css/layui.css" media="all">
    <link rel="stylesheet" href="/css/public.css" media="all">
    <script src="/lib/layui-v2.5.4/layui.js" charset="utf-8"></script>
    <script src="/projects/sys/buy.js" charset="utf-8"></script>

    <style>
        .text{
            margin-top:40px;
            text-align:justify;
            text-justify:auto;
            display: inline-block;
            text-indent: 2em;
            font-size: 20px;
            width:95%;
            line-height:40px;

        }
        .InputBox{
            display: inherit;
            width: 100%;
            padding-left: 10px;
            height: 22px;
        }
         .layui-form-item{
             margin-bottom: 15px;
             clear: both;
             *zoom: 1;
             /*border: 1px solid;*/
             display: inline-block;
             width: 31%;
         }
        .layui-btn{
            width: 12%;
            border-radius: 12px;
        }
        .layui-form-label{
            width: 113px;
        }
    </style>
</head>
<body>
    <div class="layui-tab">
        <ul class="layui-tab-title">
            <li class="layui-this">购买卡</li>
            <li id="pack">购买套餐</li>
            <li id="produce">购买产品</li>
        </ul>

        <div class="layui-tab-content" style="text-align: center;">

            <!-- 买卡 -->
            <div class="layui-tab-item layui-show" style="margin: auto;">
                <form lay-filter="updateGoodsForm" id="addFormSub" class="layui-form" enctype="multipart/form-data">
                    <div class="layui-form-item" style="width: 70%;
    margin: 26px auto;">
                        <label  class="layui-form-label" style="display: inline-block;
    width: 9%;">会员类型</label>
                        <div class="layui-input-inline" style="width: 45%;
    display: inline-block;">
                            <input type="radio" th:each="v,vstart:${vip}" name="vipid" th:value="${v.getId()}" th:title="${v.getVname()}"/>
                        </div>

                    </div>
                    <fieldset class="layui-elem-field" style="
                                        margin-top: -18px;
                                        margin-bottom: 30px;
                                        margin-left: 38px;"
                    >
                        <legend>赠送说明</legend>
                        <div class="layui-field-box">
                            <div  th:each="vi, index : ${vip}" style="margin-bottom: 1%">
                                <p style="text-align: left">
                                    <span th:text="${index.count}"></span>.&nbsp;<span th:text="${vi.getVname()}"></span>&nbsp;&nbsp;
                                    赠送套餐：<span th:text="${vi.getVpackage().getPname()}"></span>
                                    (包含产品：<span th:each="p, i: ${vi.getVpackage().getProduces()}"><span th:text="${p.getName()}"></span>&nbsp;</span>)
                                    &nbsp;&nbsp;套餐价值：￥<span th:text="${vi.getVpackage().getPrice()}"></span>
                                </p>
                                <p style="text-align: left">说明：<span th:text="${vi.getDescribe()}"></span></p>
                            </div>
                        </div>
                    </fieldset>
                    <div class="layui-form-item">
                        <label class="layui-form-label">顾客姓名</label>
                        <div class="layui-input-inline">
                            <input type="text" name="cname" th:value="${customer.cname}" lay-verify="cname" placeholder="请输入" class="layui-input">
                            <input type="hidden" name="cid" th:value="${customer.cid}" >
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">身高(厘米)</label>
                        <div class="layui-input-inline">
                            <input  type="number" name="stature" th:value="${customer.stature}" lay-verify="stature" placeholder="请输入" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">年龄</label>
                        <div class="layui-input-inline">
                            <input  type="number" name="age" th:value="${customer.age}" lay-verify="age" placeholder="请输入" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">体重(斤)</label>
                        <div class="layui-input-inline">
                            <input type="number"  name="weight" th:value="${customer.weight}" lay-verify="weight" placeholder="请输入" value="0" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">生日</label>
                        <div class="layui-input-inline">
                            <input type="text" name="birthday"th:value="${customer.birthday}" id="birthday" lay-verify="date" placeholder="yyyy-MM-dd" class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">手机号码</label>
                        <div class="layui-input-inline">
                            <input type="tel" name="phone" th:value="${customer.phone}" lay-verify="required|phone"  class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">地址</label>
                        <div class="layui-input-inline">
                            <input th:value="${customer.address}"  name="address" class="layui-input"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">胸围</label>
                        <div class="layui-input-inline">
                            <input  type="number" th:value="${customer.bust}" class="layui-input" name="bust"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">腰围</label>
                        <div class="layui-input-inline">
                            <input type="number" th:value="${customer.waistline}" class="layui-input"  name="waistline"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">臀围</label>
                        <div class="layui-input-inline">
                            <input type="number" class="layui-input" name="hip" th:value="${customer.hip}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">脂肪率(%)</label>
                        <div class="layui-input-inline">
                            <input type="number" class="layui-input" name="bodyfat" th:value="${customer.bodyfat}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">脂肪量</label>
                        <div class="layui-input-inline">
                            <input type="number" class="layui-input" name="fatmass" th:value="${customer.fatmass}"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">面部护理剩余次数</label>
                        <div class="layui-input-inline">
                            <input type="number" class="layui-input" value="0" name="faceCount" th:value="${customer.faceCount}" lay-verify="num"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">局减剩余次数</label>
                        <div class="layui-input-inline">
                            <input type="number" class="layui-input" value="0" th:value="${customer.localdecrementCount}" name="localdecrementCount" lay-verify="num"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">按摩剩余次数</label>
                        <div class="layui-input-inline">
                            <input type="number" class="layui-input" value="0" th:value="${customer.massageCount}" name="massageCount" lay-verify="num"/>
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label class="layui-form-label">办理价格</label>
                        <div class="layui-input-inline">
                            <input class="layui-input" name="price" lay-verify="price" />
                        </div>
                    </div>

                    <div class="layui-form-item layui-form-text" style="display: block; width: 89%;">
                        <label class="layui-form-label">描述</label>
                        <div class="layui-input-block" style="margin-left: 13%;">
                            <textarea name="paydesc" placeholder="请输入内容" class="layui-textarea"></textarea>
                        </div>
                    </div>
                    <div class="layui-btn-group" style="display: block;">
                        <a class="layui-btn" style="margin-right: 20px;" href="/member/memberManagerPage">返回</a>
                        <button type="reset" class="layui-btn">重置</button>
                        <button type="submit" class="layui-btn" lay-submit="" lay-filter="save1">提交</button>
                    </div>
                </form>
            </div>

            <!-- 套餐 -->
            <div class="layui-tab-item" style="text-align: center;">
                <fieldset class="layui-elem-field" style="margin-bottom: 30px;">
                    <legend>套餐列表</legend>
                    <div class="layui-field-box">
                        <form class="layui-form">
                            <input type="hidden" name="empId" th:value="${session.user.id}"/>
                            <div style="text-align: left;margin:1%; width: 100%;" class="group">
                               <div class="group-meal1 " th:each="p,index:${packages}" style="margin: 1%;">
                                   <input type="hidden" th:value="${p.pid}" name="pid">
                                   <div style="display: inline-block;width: 64%;"> 套餐<span th:text="${index.count}"></span>：<span class="unit-name" th:text="${p.pname}"></span>
                                       所含产品(
                                       <p class="produces" style="display: inline-block" th:each="pro,i:${p.produces}">
                                           <span name="produceName" th:text="${pro.name}"></span><span th:if="${!i.last}">，</span>
                                       </p>)
                                       <span style="color: #bbbbbb">￥</span> &nbsp;<span class="unit-price" th:text="${p.price}"></span>
                                   </div>
                                   <div class="layui-btn-group" style="display: inline-block;width: 16%;">
                                       <button type="button" style="width: 20%;" class="layui-btn layui-btn-sm add"><i class="layui-icon"></i></button>
                                       <button type="button" style="width: 20%; background: #d9dada;color: #0C0C0C" class="layui-btn layui-btn-sm sum">0</button>
                                       <button type="button" style="width: 20%;" class="layui-btn layui-btn-sm minus"><i class="layui-icon">–</i></button>
                                   </div>
                                   <div style="display: inline-block;width: 19%;"><span style="color: #bbbbbb">￥</span>&nbsp;<span class="group-sum groupSum1" style="font-size: 20px;">0.00</span></div>
                               </div>
                                <div style="width: 84%; margin-top: 4%;">
                                    <span style="font-size: 26px;">合计：</span>
                                    <p style="display: inline-block;line-height: 38px;float: right;font-size: 24px;">
                                        <span style="color: #bbbbbb">￥</span>&nbsp;
                                        <span class="sums">0.00</span>
                                    </p>
                                </div>
                                <div style="margin: 3%;">
                                    <button style="margin-left: 41%;width: 17%;" type="submit" class="layui-btn" lay-submit="" lay-filter="save2">确认购买</button>
                                </div>
                            </div>

                        </form>
                    </div>
                </fieldset>
                <div style="display: none;margin: 4%;" id="resultAlert">
                </div>
            </div>

            <!-- 产品 -->
            <div class="layui-tab-item" style="text-align: center;">
                <fieldset class="layui-elem-field group" style="margin-bottom: 30px;">
                    <legend>产品列表</legend>
                    <fieldset th:each="p,i:${proType}" class="layui-elem-field" style="margin-top: 41px;">
                        <legend style="font-size: 17px;" th:text="${p.name}" >产品列表1</legend>
                            <div class="group-meal2" style="margin-top: 1%; text-align: left; margin-left: 10%;" th:each="pr,index:${p.produces}">
                                <p style="display: inline-block;width: 25%;">
                                    <span name="name" th:data="${pr.id}" th:text="${pr.name}"></span>
                                    <input type="hidden" name="id" th:value="${pr.id}">
                                </p>
                                <p style="width: 26%;display: inline-block;">
                                    <span style="color: #bbbbbb">￥</span> &nbsp;<span class="unit-price" th:text="${pr.price}"></span>
                                </p>
                                <div class="layui-btn-group" style="display: inline-block;width: 16%;">
                                    <button type="button" style="width: 20%;" class="layui-btn layui-btn-sm add"><i class="layui-icon"></i></button>
                                    <button type="button" style="width: 20%; background: #d9dada;color: #0C0C0C" class="layui-btn layui-btn-sm sum">0</button>
                                    <button type="button" style="width: 20%;" class="layui-btn layui-btn-sm minus"><i class="layui-icon">–</i></button>
                                </div>
                                <div style="display: inline-block;width: 19%;"><span style="color: #bbbbbb">￥</span>&nbsp;<span class="group-sum  groupSum2" style="font-size: 20px;">0.00</span></div>
                            </div>
                    </fieldset>
                        <div style="width: 62%;margin-top: 4%;" class="group">
                            <span style="font-size: 26px;">合计：</span>
                            <p style="display: inline-block;line-height: 38px;float: right;font-size: 24px;">
                                <span style="color: #bbbbbb">￥</span>&nbsp;
                                <span class="sums">0.00</span>
                            </p>
                        </div>
                        <div style="margin: 3%;">
                            <button style="width: 17%;" type="submit" class="layui-btn" lay-submit="" lay-filter="save3">确认购买</button>
                        </div>
                    <div style="display: none;margin: 4%;" id="resultAlert1"></div>
                </fieldset>
            </div>
        </div>
    </div>
</body>
</html>